﻿<UserControl x:Class="VAdvantage.Widgets.WeatherControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"			  
	xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:this="clr-namespace:VAdvantage.Widgets"
	mc:Ignorable="d"
    d:DesignHeight="170" d:DesignWidth="306" Background="Transparent">
    <UserControl.Resources>
        <Style x:Key="CityName" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Arial"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="5,0,0,0"/>
        </Style>
        <Style x:Key="WeatherStatus" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Arial"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="5,5,0,0"/>
        </Style>
        <Style x:Key="Temp" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Arial"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="5,0,0,0"/>
        </Style>

        <Style x:Key="TempL" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Arial"/>
            <Setter Property="FontSize" Value="22"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Margin" Value="5,5,0,0"/>
            <!--<Setter Property="FontWeight" Value="Bold"/>-->
        </Style>
        <Style x:Key="AMPM" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Arial"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Height" Value="17"/>
            <Setter Property="Width" Value="20"/>
            <Setter Property="Opacity" Value="0.5"/>
        </Style>
        <Style x:Key="CounterStyle" TargetType="Border">
            <Setter Property="BorderBrush" Value="Black"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Height" Value="70"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="Gray" Offset="0"/>
                        <!--#9911e400-->
                        <GradientStop Color="#00a0ff8c" Offset="0.2"/>
                        <GradientStop Color="Gray" Offset="1"/>
                        <!--#990c9d00-->
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Canvas x:Name="CanvasRoot" Height="150" Width="300" Background="Transparent">
        <!--<Canvas.Background>
				<ImageBrush  ImageSource="images/back9.png" AlignmentX="Left" AlignmentY="Top" Stretch="Fill"/>
			</Canvas.Background>-->
            <Grid x:Name="LayoutRoot" Canvas.Left="0" Canvas.Top="15" Height="130" Width="300">
                <Grid.RowDefinitions>
                    <RowDefinition Height="80"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.Background>
                    <ImageBrush ImageSource="/VAdvantage;component/Images/weather_wedget_bg.png" AlignmentX="Left" AlignmentY="Top" Stretch="Fill" />
                </Grid.Background>

                <Grid x:Name="grdWeather" Grid.Row="1" Margin="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                        <ColumnDefinition Width="150"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Vertical" Grid.Column="0" Margin="3,5,0,0">
                        <TextBlock x:Name="tbCityName" Text="City Name" Style="{StaticResource CityName}"/>
                    <TextBlock x:Name="tbWeatherStatus" Text="Weather Status" TextWrapping="Wrap" Width="142" Style="{StaticResource WeatherStatus }" />
                    </StackPanel>
                    <Grid x:Name="grdReadings" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,5,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="50"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="tbTemp" Style="{StaticResource TempL}" Text="0°" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        <TextBlock Text="Dew: " Style="{StaticResource Temp}" Margin="0,9,0,0" Width="35" Height="20" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        <TextBlock Text="Hum: " Style="{StaticResource Temp}" Margin="0,28,0,0" Width="35" Height="20" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        <TextBlock x:Name="tbHTemp" Text="0°" Style="{StaticResource Temp}" Margin="35,9,0,0" Width="35" Height="20" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        <TextBlock x:Name="tbLTemp" Text="0°" Style="{StaticResource Temp}" Margin="35,28,0,0" Width="35" Height="20" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                    </Grid>
                </Grid>
            </Grid>
            <StackPanel Orientation="Horizontal" Canvas.Top="0" Canvas.Left="50" HorizontalAlignment="Center" Margin="0,0,0,0">
                <Border>
                    <!--Style="{StaticResource CounterStyle}"-->
                    <this:Counter  x:Name="H1" />
                </Border>
                <Border Margin="20,0,0,0">
                    <!--Style="{StaticResource CounterStyle}"-->
                    <this:Counter x:Name="M1" />
                </Border>
            </StackPanel>
            <TextBlock x:Name="tbAMPM" Text="AM" Canvas.Left="55" Canvas.Top="65" Style="{StaticResource AMPM}"/>
            <Image x:Name="imgWeatherStatus" Source="/VAdvantage;component/Images/Day.png" Height="80" Width="80" Canvas.Top="78" Canvas.Left="112" />
        <Image x:Name="imgSettings" Canvas.Top="17" Canvas.Left="272" Height="25" Width="25" Source="/VAdvantage;component/Images/settings.png" MouseLeftButtonDown="imgSettings_MouseLeftButtonDown" />
        </Canvas>
</UserControl>
